#include "SevenRecordTopic.h"

#include "stream/Topic.h"
#include "stream/Appender.h"

using namespace stream;

SevenRecordTopic::SevenRecordTopic()
: _topic(::stream::makeTopic("hello", "."))
, _appender(::stream::makeAppender(_topic))
{
    _appender->open();

    for(size_t i = 0; i < _expectRecord; ++i){
        _appender->append(i, "GTP" + std::to_string(i+1));
    }
}
SevenRecordTopic::~SevenRecordTopic(){
	_topic->clear();
    _appender->close();
}


std::shared_ptr<Topic> SevenRecordTopic::topic() const{
    return _topic;
}
void SevenRecordTopic::clear(){
	_topic->clear();
}
